package com.heihei.common.tree;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;

import java.io.Serializable;
import java.util.List;

public interface INode<T> extends Serializable {
    @JsonSerialize(
            using = ToStringSerializer.class
    )
    Long getId();

    @JsonSerialize(
            using = ToStringSerializer.class
    )
    Long getParentId();

    List<T> getChildren();

    default Boolean getHasChildren() {
        return false;
    }
}
